#import "ALRubberBandView.h"


#pragma mark Constants
static const CGFloat ALRubberBandCornerRadius = 3.0f;


#pragma mark -
#pragma mark Class Globals
static NSColor *ALRubberBandBackgroundColor;
static NSColor *ALRubberBandBorderColor;


#pragma mark -
@implementation ALRubberBandView

+(void)initialize {
	ALRubberBandBackgroundColor = [[NSColor colorWithCalibratedRed:0.577f green:0.615f blue:0.75f alpha:0.3f] retain];
	ALRubberBandBorderColor = [[NSColor colorWithCalibratedRed:0.429 green:0.489 blue:0.576 alpha:0.5f] retain];
}

-(void)drawRect:(NSRect)dirtyRect {
	// TODO: FIX INSET TO USE SCALE FACTOR RATHER THAN HARD CODE 0.5
	NSRect bounds = NSInsetRect([self bounds], 0.5, 0.5);
	NSBezierPath *borderPath = [NSBezierPath bezierPathWithRoundedRect:bounds xRadius:ALRubberBandCornerRadius yRadius:ALRubberBandCornerRadius];
	[ALRubberBandBackgroundColor setFill];
	[ALRubberBandBorderColor setStroke];
	[borderPath fill];
	[borderPath stroke];
}

@end
